import card.AiQiYiCardService;
import com.alibaba.fastjson.JSON;

import java.util.Map;
import java.util.logging.Logger;

public class CardCommodityService implements ICommodity
{
	private Logger logger = Logger.getLogger(CardCommodityService.class.toString());
	// 模拟注入
	private AiQiYiCardService iQiYiCardService = new AiQiYiCardService();
	@Override
	public void sendCommodity(String uId, String commodityId, String bizId, Map<String, String> extMap) throws Exception
	{
		String mobile = this.queryUserMobile(uId);
		this.iQiYiCardService.grantToken(mobile, bizId);
		this.logger.info("请求参数[爱奇艺兑换卡] => uId：" + uId + "; commodityId：" + commodityId + "; bizId：" + bizId + "; extMap：" + JSON.toJSON(extMap));
		this.logger.info("测试结果[爱奇艺兑换卡]：success");
	}
	private String queryUserMobile(String uId)
	{
		return("15200101232");
	}
}
